import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class ServiceProviderEditContainer extends StatelessWidget {
  const ServiceProviderEditContainer(
      {Key? key, required this.child, this.onEdit})
      : super(key: key);
  final Widget child;
  final void Function()? onEdit;

  @override
  Widget build(BuildContext context) {
    return Container(
      color: CupertinoColors.white,
      width: double.infinity,
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          child,
          Divider(
            color: Color(0xffe5e5e5),
            height: 0.5,
            indent: 16.0,
            endIndent: 16.0,
          ),
          GestureDetector(
            behavior: HitTestBehavior.translucent,
            child: Padding(
              padding: EdgeInsets.all(6.0),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Text(
                    '编辑',
                    style: TextStyle(color: Color(0xff009cfe), fontSize: 12.0),
                  ),
                  SizedBox(
                    width: 5.0,
                  ),
                  Image.asset(
                      'images/service_provider/service_provider_edit_icon.png'),
                ],
              ),
            ),
            onTap: onEdit,
          ),
        ],
      ),
    );
  }
}
